home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Magazine / Morphos / GCC / ppc-amigaos / include / gl / glsmap.h < prev    next >
C/C++ Source or Header  |  1998-12-15  |  5KB  |  148 lines

  1. #ifndef __glsmap_h__
  2. #define __glsmap_h__
  3.  
  4. /* Copyright (c) Mark J. Kilgard, 1998.  */
  5.  
  6. /* This program is freely distributable without licensing fees
  7.    and is provided without guarantee or warrantee expressed or
  8.    implied. This program is -not- in the public domain. */
  9.  
  10. #if defined(_WIN32)
  11.  
  12. /* Try hard to avoid including <windows.h> to avoid name space pollution,
  13.    but Win32's <GL/gl.h> needs APIENTRY and WINGDIAPI defined properly. */
  14. # if 0
  15. #  define  WIN32_LEAN_AND_MEAN
  16. #  include <windows.h>
  17. # else
  18.    /* XXX This is from Win32's <windef.h> */
  19. #  ifndef APIENTRY
  20. #   if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)
  21. #    define APIENTRY    __stdcall
  22. #   else
  23. #    define APIENTRY
  24. #   endif
  25. #  endif
  26. #  ifndef CALLBACK
  27.     /* XXX This is from Win32's <winnt.h> */
  28. #   if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS)
  29. #    define CALLBACK __stdcall
  30. #   else
  31. #    define CALLBACK
  32. #   endif
  33. #  endif
  34.    /* XXX This is from Win32's <wingdi.h> and <winnt.h> */
  35. #  ifndef WINGDIAPI
  36. #   define WINGDIAPI __declspec(dllimport)
  37. #  endif
  38.    /* XXX This is from Win32's <ctype.h> */
  39. #  ifndef _WCHAR_T_DEFINED
  40. typedef unsigned short wchar_t;
  41. #   define _WCHAR_T_DEFINED
  42. #  endif
  43. # endif
  44.  
  45. #pragma warning (disable:4244)  /* Disable bogus conversion warnings. */
  46. #pragma warning (disable:4305)  /* VC++ 5.0 version of above warning. */
  47.  
  48. #endif /* _WIN32 */
  49.  
  50. #include <GL/gl.h>
  51.  
  52. #ifdef __cplusplus
  53. extern "C" {
  54. #endif
  55.  
  56. typedef enum {
  57.         SMAP_CLEAR_SMAP_TEXTURE = 0x1,
  58.         SMAP_GENERATE_VIEW_MIPMAPS = 0x2,
  59.         SMAP_GENERATE_SMAP_MIPMAPS = 0x4,
  60.         SMAP_GENERATE_MIPMAPS = 0x6  /* both of above */
  61. } SphereMapFlags;
  62.  
  63. /* Cube view enumerants. */
  64. enum {
  65.         SMAP_FRONT = 0,
  66.         SMAP_TOP = 1,
  67.         SMAP_BOTTOM = 2,
  68.         SMAP_LEFT = 3,
  69.         SMAP_RIGHT = 4,
  70.         SMAP_BACK = 5
  71. };
  72.  
  73. typedef struct _SphereMap SphereMap;
  74.  
  75. #if defined(__STORM__) && defined(__PPC__) && !defined(COMPILING_GLSMAP)
  76. #include <stormprotos/glsmap_sprotos.h>
  77. #else
  78.  
  79. extern SphereMap *smapCreateSphereMap(SphereMap *shareSmap);
  80. extern void smapDestroySphereMap(SphereMap *smap);
  81.  
  82. extern void smapConfigureSphereMapMesh(SphereMap *smap, int steps, int rings, int edgeExtend);
  83.  
  84. extern void smapSetSphereMapTexObj(SphereMap *smap, GLuint texobj);
  85. extern void smapSetViewTexObj(SphereMap *smap, GLuint texobj);
  86. extern void smapSetViewTexObjs(SphereMap *smap, GLuint texobjs[6]);
  87. extern void smapGetSphereMapTexObj(SphereMap *smap, GLuint *texobj);
  88. extern void smapGetViewTexObj(SphereMap *smap, GLuint *texobj);
  89. extern void smapGetViewTexObjs(SphereMap *smap, GLuint texobjs[6]);
  90.  
  91. extern void smapSetFlags(SphereMap *smap, SphereMapFlags flags);
  92. extern void smapGetFlags(SphereMap *smap, SphereMapFlags *flags);
  93.  
  94. extern void smapSetViewOrigin(SphereMap *smap, GLint x, GLint y);
  95. extern void smapSetSphereMapOrigin(SphereMap *smap, GLint x, GLint y);
  96. extern void smapGetViewOrigin(SphereMap *smap, GLint *x, GLint *y);
  97. extern void smapGetSphereMapOrigin(SphereMap *smap, GLint *x, GLint *y);
  98.  
  99. extern void smapSetEye(SphereMap *smap, GLfloat eyex, GLfloat eyey,     GLfloat eyez);
  100. extern void smapSetEyeVector(SphereMap *smap, GLfloat *eye);
  101. extern void smapSetUp(SphereMap *smap, GLfloat upx, GLfloat upy, GLfloat upz);
  102. extern void smapSetUpVector(SphereMap *smap, GLfloat *up);
  103. extern void smapSetObject(SphereMap *smap, GLfloat objx, GLfloat objy, GLfloat objz);
  104. extern void smapSetObjectVector(SphereMap *smap, GLfloat *obj);
  105. extern void smapGetEye(SphereMap *smap, GLfloat *eyex, GLfloat *eyey, GLfloat *eyez);
  106. extern void smapGetEyeVector(SphereMap *smap, GLfloat *eye);
  107. extern void smapGetUp(SphereMap *smap, GLfloat *upx, GLfloat *upy, GLfloat *upz);
  108. extern void smapGetUpVector(SphereMap *smap, GLfloat *up);
  109. extern void smapGetObject(SphereMap *smap, GLfloat *objx, GLfloat *objy, GLfloat *objz);
  110. extern void smapGetObjectVector(SphereMap *smap, GLfloat *obj);
  111.  
  112. extern void smapSetNearFar(SphereMap *smap, GLfloat viewNear, GLfloat viewFar);
  113. extern void smapGetNearFar(SphereMap *smap, GLfloat *viewNear, GLfloat *viewFar);
  114.  
  115. extern void smapSetSphereMapTexDim(SphereMap *smap, GLsizei texdim);
  116. extern void smapSetViewTexDim(SphereMap *smap, GLsizei texdim);
  117. extern void smapGetSphereMapTexDim(SphereMap *smap, GLsizei *texdim);
  118. extern void smapGetViewTexDim(SphereMap *smap, GLsizei *texdim);
  119.  
  120. extern void smapSetContextData(SphereMap *smap, void *context);
  121. extern void smapGetContextData(SphereMap *smap, void **context);
  122.  
  123. extern void smapSetPositionLightsFunc(SphereMap *smap, void (*positionLights)(int view, void *context));
  124. extern void smapSetDrawViewFunc(SphereMap *smap, void (*drawView)(int view, void *context));
  125. extern void smapGetPositionLightsFunc(SphereMap *smap, void (**positionLights)(int view, void *context));
  126. extern void smapGetDrawViewFunc(SphereMap *smap, void (**drawView)(int view, void *context));
  127.  
  128. extern void smapGenViewTex(SphereMap *smap, int view);
  129. extern void smapGenViewTexs(SphereMap *smap);
  130. extern void smapGenSphereMapFromViewTexs(SphereMap *smap);
  131. extern void smapGenSphereMap(SphereMap *smap);
  132. extern void smapGenSphereMapWithOneViewTex(SphereMap *smap);
  133.  
  134. extern int smapRvecToSt(float rvec[3], float st[2]);
  135. extern void smapStToRvec(float *st, float *rvec);
  136.  
  137. #if defined(__VBCC__) && (defined(GL_INLINE) || defined(__PPC__))
  138. #include <proto/glsmap.h>
  139. #endif
  140.  
  141. #endif
  142.  
  143. #ifdef __cplusplus
  144. }
  145.  
  146. #endif
  147. #endif /* __glsmap_h__ */
  148.